<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2023/5/11
  Time: 10:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath()+"/";%>
<html>
<head>
    <base href="<%=path%>">
    <title>用户列表</title>
    <link rel="stylesheet" href="hplus/static/bootstrap-table.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free@5.12.1/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

</head>
    <style>
    .a{
        background-color: #0d8ddb;
    }
</style>
<body>

<div>
    <form method="get" action="user/list" id="searchForm">
        登录名:<input type="text" name="loginName" >
        手机号:<input type="text" name="mobiile" >
        部门状态:
        <select name="status">
            <option value="-1">全部</option>
            <option value="0"  >启用</option>
            <option value="1" >停用</option>
        </select>
        创建时间:<input type="text" name="gmtCreate" >--
        <input type="text"  name="gmtModified"/>
        <button class="btn btn-primary" type="button" onclick="$.table.search()">搜索</button>
        <button class="btn btn-primary" type="button" onclick="$.table.reset()">重置</button>
    </form>
</div>
<table id="table">
</table>
<div id="toolbar" style="padding-left:5px;">
    <button class="btn btn-primary" onclick="$.modal.openWin('新增用户信息','user/toEdit','500px','500px');"><span class="glyphicon glyphicon-plus"></span>新增</button>
    <button class="btn btn-warning" onclick="$.operator.deletes('user/deletes');"><span class="glyphicon glyphicon-trash"></span>批量删除</button>
</div>
</body>
<script src="hplus/static/bootstrap-table.min.js"></script>
<script type="text/javascript" src="hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
<script src="hplus/js/plugins/layer/layer.min.js" type="text/javascript"></script>
<script src="hplus/js/sofwin.js"></script>
<script>

    $(function() {
        var columns = [
            {
                checkbox: true,

            },{
                field: 'userName',
                title: '用户名',
                visible: true
            },{
                field: 'loginName',
                title:'登录名',
                width: 300,
                halign: 'center',
                align: 'right'
            },{
                field:'sex',
                title:'性别',
                formatter:function(value,b,c,d){
                    if(value==0){
                        return '女';
                    }
                    return '男';
                },
                sortable:true
            },{
                title: '操作',
                width: 200,
                align: "center",
                formatter:function(a,b,c,d){
                    console.info(b)
                    var editUrl='$.modal.openWin(\'编辑用户信息\',\'user/toEdit?id='+b.id+'\');';
                    var deleteUrl='$.operator.delete(\'user/delete/'+b.id+'\')';
                    var str= '<a class="btn btn-xs btn-primary" onclick="'+editUrl+'">编辑</a>&nbsp;&nbsp;'+
                        '<a class="btn btn-xs btn-primary" onclick="'+deleteUrl+'">删除</a>';
                    console.info(str)
                    return str;
                }
            }
        ];
        $.table.initTable(columns,'user/data');
    })
</script>
</html>
